define(
    function (require) {
        require('tpl!./form.tpl.html');

        var u = require('underscore');
        var ubRiaUtil = require('ub-ria/util');

        var BaseFormView = require('common/FormView');

        function FormView() {
            BaseFormView.apply(this, arguments);
        }

        FormView.prototype.template = 'experienceTicketForm';

        FormView.prototype.enterDocument = function() {
            BaseFormView.prototype.enterDocument.apply(this, arguments);
        };

        /**
         * 从表单中获取实体数据
         *
         * @return {Object}
         */
        FormView.prototype.getEntity = function () {
            var entity = BaseFormView.prototype.getEntity.apply(this, arguments);
            if(entity.phone.length === 11){
                if(!isNaN(entity.num)){
                    if(entity.sureTransflg === "能") {
                        entity.sureTransflg = 0;
                        return entity;
                    }else {
                        entity.sureTransflg = 1;
                        return entity;
                    }
                }else{
                    alert("请输入正确数字！");
                }
            }else{
                alert("请输入正确格式的手机号！");
            }
        };

        require('er/util').inherits(FormView, BaseFormView);
        return FormView;
    }
);
